package br.com.caim.email.auth;

import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;

public class MailAuthenticator extends Authenticator {
	
	private String from;
	private String usuarioId;
	
	public MailAuthenticator(String from, String usuarioId) {
		this.from = from;
		this.usuarioId = usuarioId;
	}

	public PasswordAuthentication getPasswordAuthentication() {
	  
		String auth[] = new String[2];
		
		// TODO Corrigir comunicacao com banco de dados
		//auth = ComunicacaoBanco.getInstance().realizarAutenticacaoConta(from, usuarioId);
		auth[0] = "felipe.dspereira@gmail.com";
		auth[1] = "46e8646e86";
	  
		// Login e senha		  
		return new PasswordAuthentication(from, usuarioId);
	}
}